package com.qfjy.homework.zhaochen;

import com.qfjy.homework.zhaochen.calculation.OperationAdd;
import com.qfjy.homework.zhaochen.calculation.OperationDivision;
import com.qfjy.homework.zhaochen.calculation.OperationMultiplication;
import com.qfjy.homework.zhaochen.calculation.OperationSubtraction;

/**
 * @author:zhaochen
 * @date:2022/6/29 19:19
 * @version:1.0
 */
public class TestDemo {
    public static void main(String[] args) {
        Context context = new Context(new OperationAdd());
        System.out.println(context.executeStrategy(20,10));
        Context context1 =new Context(new OperationSubtraction());
        System.out.println(context1.executeStrategy(20,10));
        Context context2 = new Context(new OperationMultiplication());
        System.out.println(context2.executeStrategy(20,10));
        Context context3 = new Context(new OperationDivision());
        System.out.println(context3.executeStrategy(20,10));
    }
}
